import React from 'react'
import './index.css'
import Item from './Item'

export default function List({todoList,setTodoList}) {
  // console.log(props);
  //在传参时已经把todoList解构赋值了,在下面不需要再解构赋值
  // const {todoList} = todoList
  return (
    <ul className="todo-main">
      {/* <Item /> */}
      {todoList.map(item=>{
        return <Item key = {item.id} {...item} setTodoList={setTodoList} todoList={todoList}/>
      })}
  </ul>
  )
}
